package com.getpebble.android.framework.protocol.inbound;

import com.getpebble.android.bluetooth.protocol.ProtocolMessage;
import com.getpebble.android.common.core.trace.Trace;
import com.getpebble.android.framework.appmessage.AppLifecycleMessage;
import com.getpebble.android.framework.protocol.EndpointId;

public class PblInboundAppLifecycleMessage extends PblInboundAppMessage {
    private AppLifecycleMessage mLifecycleMessage = null;

    public PblInboundAppLifecycleMessage(ProtocolMessage message) {
        super(message);
        if (getAppMessage() != null) {
            this.mLifecycleMessage = new AppLifecycleMessage(getAppMessage());
        } else {
            Trace.error("PblInboundAppLifecycleMessage", "Received lifecycle message without AppMessage");
        }
    }

    EndpointId getId() {
        return EndpointId.APP_LIFECYCLE;
    }

    protected int getMinSize() {
        return 0;
    }

    public AppLifecycleMessage getLifecycleMessage() {
        return this.mLifecycleMessage;
    }
}
